package com.prs.crm.domain.oa;

import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;

import com.prs.crm.domain.Attachment;
import com.prs.crm.domain.BaseEntity;
/**
 * 文件传输
 * @author miccn
 *
 */

@Entity
@Table(name="oa_filesend")
public class FileSend extends BaseEntity{
	private static final long serialVersionUID = 1L;
	
	@Id
	@GeneratedValue(strategy=GenerationType.IDENTITY)
	private Integer id;
	private String title; //标题
	@ManyToOne(fetch=FetchType.LAZY)
	@Cascade({org.hibernate.annotations.CascadeType.ALL,org.hibernate.annotations.CascadeType.DELETE_ORPHAN})
	private Attachment attach; //文件
	@Lob
	private String content; //内容
	@OneToMany(fetch=FetchType.LAZY,mappedBy="fileSend")
	private Set<FileSendAccept> accepts; //接收人
	private String type; //重要程度
	private Integer oabox; //所在位置
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public Attachment getAttach() {
		return attach;
	}
	public void setAttach(Attachment attach) {
		this.attach = attach;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Set<FileSendAccept> getAccepts() {
		return accepts;
	}
	public void setAccepts(Set<FileSendAccept> accepts) {
		this.accepts = accepts;
	}
	public String getType() {
		return type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Integer getOabox() {
		return oabox;
	}
	public void setOabox(Integer oabox) {
		this.oabox = oabox;
	}
}
